package com.demo1;

public class Car {
    String carName;
    int carAge;
    String carColor;

    public void show(){
        //打印的是调用者的信息
        System.out.println("carName="+this.carName);
        System.out.println("carAge="+this.carAge);
        System.out.println("carColor="+this.carColor);
        Engine engine = new Engine();
        engine.engineName="BMW";
        engine.engineAge=1;
        engine.show();
    }

    class Engine {
        String engineName;
        int engineAge;

        public void show(){
            System.out.println("engineName="+engineName);
            System.out.println("engineAge="+engineAge);
        }
    }
}
